{template header}
		<script type="text/javascript" src="{THEME_PATH}avatar/swfobject.js"></script>
		<script type="text/javascript" src="{THEME_PATH}avatar/fullAvatarEditor.js"></script>
		<script src="{JS_PATH}artDialog/artDialog.js" type="text/javascript"></script>
		<div class="main w1100">
			{template setting_left}
				<div class="content fr">
					<div class="dizhi">
						<h3>头像设置</h3>
						<dl>
							<dt style="height:0;padding:0;border-bottom: none;"><em><a href="javascript:location.reload();" class="shua"></a></em></dt>
							<dd>
								<div class="portrait">
									<strong>
                                     		   请选择头像
                                    </strong>
									<em class="load_head"><a href="javascript:void(0);" onclick="$('.upload_img').show();">从电脑中选择</a></em>
									<ul class="hpor fl" id="img_list">
										<li>
											<img src="{if $ico}{ROOT_PATH}/uploadfile/avatar/<?php echo $this->userid; ?>_200.jpg{else}{THEME_PATH}images/default.jpg{/if}" width="200" height="200" alt="" /><span>200*200</span>
										</li>
										<li>
											<img src="{if $ico}{ROOT_PATH}/uploadfile/avatar/<?php echo $this->userid; ?>_80.jpg{else}{THEME_PATH}images/default.jpg{/if}" width="80" height="80" alt="" /><span>80*80</span>
										</li>
										<li>
											<img src="{if $ico}{ROOT_PATH}/uploadfile/avatar/<?php echo $this->userid; ?>_50.jpg{else}{THEME_PATH}images/default.jpg{/if}" width="50" height="50" alt="" /><span>50*50</span>
										</li>
									</ul>
									<div class="porr fr">
										<p class="org">
											·点击从电脑中选择上传您的会员头像
											<br /> ·请勿在形象标识上留有任何联系方式的信息
											<br /> ·支持JPG格式，图片大小不超过5MB
											<br /> ·请保证图片质量，头像尺寸至少为200*200px
										</p>
									</div>
									<div class="clear"></div>
								</div>
							</dd>
						</dl>
					</div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<!--{subtemplate common/footer}-->
		<div class="upload_img" style="display: none;">
			<dl>
				<dt><strong>上传头像图片</strong><em><img src="{THEME_PATH}images/ico_close.png" onclick="$('.upload_img').hide();" /></em></dt>
				<dd>
					<p id="swfContainer">本组件需要安装Flash Player后才可使用，请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。</p>
				</dd>
			</dl>
		</div>
	</body>
	<script type="text/javascript">
				var url ="<?php echo U('User/Upload/upload_user_avatar')?>";
				var swf_file = "<?php echo THEME_PATH.'avatar/fullAvatarEditor.swf'?>";
				swfobject.addDomLoadEvent(function() {
					var swf = new fullAvatarEditor("swfContainer",440,690, {
						id: 'swf',
						file : swf_file,
						//upload_url: './upload.php',
						method:'get',
						upload_url:url,
						avatar_sizes: "200*200|80*80|50*50",
						avatar_sizes_desc: "200*200像素|80*80像素|50*50像素",
						checkbox_visible:false,
						src_upload: 2
					}, function(msg) {
						switch(msg.code)
						{
							case 3 :
								if(msg.type == 0)
								{
									alert("摄像头已准备就绪且用户已允许使用。");
								}
								else if(msg.type == 1)
								{
									alert("摄像头已准备就绪但用户未允许使用！");
								}
								else
								{
									alert("摄像头被占用！");
								}
							break;
							case 5 : 
								if(msg.type == 0)
								{
									location.reload();
								}else{
									alert(msg.content.msg);
								}
							break;
						}
					});
				});
			</script>
</html>